<?php
namespace app\common\validate;
use think\Validate;


class Software extends Validate
{

     /**
             * name: ada ad
             *   version: 四川省菜市场
            *    notice: 四川省菜市场
             *   heart_time: 四川省菜市场
             *   software_up: sfsdfcfdcbdfsdvxzv
            *    software_state: 0
             *   machine_type: 1
             *   machine_down: 0
            *machine_recoup: 0
             */
	
	protected $rule=[
		'softwarename|程序名'=>'require|unique:software',
        'version|程序版本'=>'require',
        'notice|程序公告'=>'require',
		'heart_time|心跳间隔'=>'require|number',
		'software_up|程序更新地址'=>'require',
		'software_state|程序状态'=>'require',
		'machine_type|程序是否强制绑定机器码'=>'require',
		'machine_down|程序能不能解绑'=>'require',
		'machine_recoup|解绑扣除点数'=>'require|number'
		
	];
	//添加场景 验证
	public function sceneAdd()
	{
		 return $this->only(['softwarename','version','notice','heart_time','software_up','software_state','machine_type','machine_down','machine_recoup']);
	}
    //编辑场景 验证
	public function sceneEdit()
	{
		 return $this->only(['softwarename','version','notice','heart_time','software_up','software_state','machine_type','machine_down','machine_recoup']);
	}

	

}